

app.get("/weather/now/",(req,res)=>{
        res.send = function (data) {
             res.setHeader("Access-Control-Allow-Origin", "*");
            // res.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
             res.setHeader("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
            res.setHeader("Content-Type", "application/json;charset=utf-8");
            res.end(data);
            res.alreadySend = true;
        }
        let r={
            "data":"get1 ok"
        }
        if(req.params.callback){
            res.end(`${req.params.callback}(${JSON.stringify(r)})`)
            return;
        }
      res.send(JSON.stringify(r))

})




app.begin((req,res)=>{
    if(req.url.startsWith("/_run_")){
        return;
    }
    console.log(req.method+" "+req.url,req.body)
})